export const detailFormOption = {
  submitBtn: false,
  emptyBtn: false,
  group: [
    {
      icon: 'el-icon-vertical-bar',
      label: '基本信息',
      collapse: true,
      prop: 'group1',
      detail: true,
      column: [
        {
          label: '发货单号',
          prop: 'outboundOrderNo',
          disabled: true,
          span: 6
        },
        {
          label: '客户名称',
          prop: 'customerName',
          disabled: true,
          span: 6
        },
        {
          label: '产品编码',
          prop: 'productPartNo',
          disabled: true,
          span: 6
        },
        {
          label: '产品型号',
          prop: 'productPartModel',
          disabled: true,
          span: 6
        },
        {
          label: '需求数量',
          prop: 'planOutboundQuantity',
          disabled: true,
          span: 6
        },
        {
          label: '发货数量',
          prop: 'actualDeliveryTime',
          disabled: true,
          span: 6
        },
        {
          label: '下单时间',
          prop: 'outboundOrderCreateTime',
          disabled: true,
          span: 6
        },
        {
          label: '发货时间',
          prop: 'actualDeliveryTime',
          disabled: true,
          span: 6
        }
      ]
    },
    {
      icon: 'el-icon-vertical-bar',
      label: '订单关联的工单',
      collapse: false,
      prop: 'group1',
      column: [
        {
          span: 24,
          labelWidth: 0,
          label: '',
          prop: 'workOrderTable'
        }
      ]
    },
    {
      icon: 'el-icon-vertical-bar',
      label: '排程信息',
      collapse: false,
      prop: 'group1',
      column: [
        {
          labelWidth: 0,
          span: 24,
          label: '',
          prop: 'processTable'
        }
      ]
    },
    {
      icon: 'el-icon-vertical-bar',
      label: '原材料发料信息',
      collapse: false,
      prop: 'group1',
      column: [
        {
          labelWidth: 0,
          span: 24,
          label: '',
          prop: 'materialTable'
        }
      ]
    },
    {
      icon: 'el-icon-vertical-bar',
      label: '生产信息',
      collapse: false,
      prop: 'group1',
      column: [
        {
          labelWidth: 0,
          label: '',
          span: 24,
          prop: 'productTable'
        }
      ]
    },
    {
      icon: 'el-icon-vertical-bar',
      label: '入库信息',
      collapse: false,
      prop: 'group1',
      column: [
        {
          labelWidth: 0,
          label: '',
          span: 24,
          prop: 'warehouseTable'
        }
      ]
    }
  ]
};

const baseConfig = {
  height: 'calc(100vh - 520px)',
  calcHeight: 30,
  tip: false,
  searchShow: true,
  border: true,
  index: true,
  indexLabel: '序号',
  // searchMenuSpan: 6,
  searchLabelWidth: 140,
  viewBtn: false,
  addBtn: false,
  editBtn: false,
  delBtn: false,
  labelWidth: 190,
  selection: true,
  dialogClickModal: false,
  searchMenuPosition: 'right',
  searchSpan: 6,
  menu: false,
  columnBtn: false,
  refreshBtn: false
};

export const workOrderTableOption = {
  ...baseConfig,
  column: [
    { label: '工单号', prop: 'workOrderNo' },
    {
      label: '工单状态',
      prop: 'status',
      dataType: 'string',
      props: {
        label: 'dictValue',
        value: 'dictKey'
      },
      dicUrl: '/api/blade-system/dict/dictionary?code=mfg_work_order'
    },
    { label: '工单数量', prop: 'planQuantity' },
    { label: '投入数', prop: 'inputQuantity' },
    { label: '完工数', prop: 'completedQuantity' },
    { label: '生产进度', prop: 'completedRate' },
    { label: '不良品数量', prop: 'ngQuantity' },
    { label: '在制品数量', prop: 'wipQuantity' },
    { label: '入库数量', prop: 'inboundQuantity' }
  ]
};

export const processTableOption = {
  ...baseConfig,
  column: [
    { label: '要求交付日期', prop: 'planDeliveryDate' },
    { label: '客户编码', prop: 'customerName' },
    { label: '客户名称', prop: 'customerCode' },
    { label: '发货单号', prop: 'outboundOrderNo' },
    { label: '行号', prop: 'outboundOrderLot' },
    { label: '产品编码', prop: 'productPartName' },
    { label: '产品型号', prop: 'productPartModel' },
    { label: '需求数量', prop: 'planOutboundQuantity' },
    { label: '发货数量', prop: 'actualOutboundQuantity' },
    { label: '实际发货日期', prop: 'actualDeliveryTime' },
    { label: '准时发货', prop: 'isOnTimeDelivery' },
    { label: '下单日期', prop: 'outboundOrderCreateTime' }
  ]
};

export const materialTableOption = {
  ...baseConfig,
  column: [
    { label: '要求交付日期', prop: 'planDeliveryDate' },
    { label: '客户编码', prop: 'customerName' },
    { label: '客户名称', prop: 'customerCode' },
    { label: '发货单号', prop: 'outboundOrderNo' },
    { label: '行号', prop: 'outboundOrderLot' },
    { label: '产品编码', prop: 'productPartName' },
    { label: '产品型号', prop: 'productPartModel' },
    { label: '需求数量', prop: 'planOutboundQuantity' },
    { label: '发货数量', prop: 'actualOutboundQuantity' },
    { label: '实际发货日期', prop: 'actualDeliveryTime' },
    { label: '准时发货', prop: 'isOnTimeDelivery' },
    { label: '下单日期', prop: 'outboundOrderCreateTime' }
  ]
};

export const productTableOption = {
  ...baseConfig,
  column: [
    { label: '工单号', prop: 'workOrderNo' },
    { label: '派工产线', prop: 'workOrderNo' },
    { label: '派工数量', prop: 'workOrderNo' },
    { label: '完工数', prop: 'workOrderNo' },
    { label: '不良数', prop: 'workOrderNo' },
    { label: '计划完工时间', prop: 'workOrderNo' },
    { label: '实际完工时间', prop: 'workOrderNo' },
    {
      label: '是否按计划完工',
      prop: 'workOrderNo',
      type: 'select',
      dicData: [
        { label: '是', value: true },
        { label: '否', value: false }
      ]
    }
  ]
};

export const warehouseTableOption = {
  ...baseConfig,
  column: [
    { label: '工单号', prop: 'workOrderNo' },
    { label: '工单数量', prop: 'planQuantity' },
    { label: '入库数量', prop: 'inboundQuantity' },
    { label: '入库时间', prop: 'inboundTime' },
    { label: '操作人', prop: 'inboundByName' }
  ]
};
